/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package models;

import cstAndEnum.*;
import models.Deck.*;


/**
 *玩家
 * @author Invince
 */
public class Player {
   /*----------Attributs-------------------*/
    /**
     * 玩家名字
     */
    protected String name;
    /**
     * 玩家身份：主公MAJESTY，忠臣LOYAL，反贼REBEL，内奸SPY
     */
    protected CARAC carac;
    /**
     * 玩家铁索状态
     */
    protected STATE_CHAIN stateChain;
    /**
     * 玩家持有的牌
     */
    protected DeckPlayer deckPlayer;
    /**
     * 玩家的装备库
     */
    protected DeckEquipement deckEqp;
    /**
     * 需要判定的牌
     */
    protected DeckBuff deckBuff;
    /**
     * 武将
     */
    protected Role role;

   /*----------Public functions------------*/
    /**
     * 判断玩家是否相等（只有类型和名字）
     * @param obj
     * @return
     */
   @Override
   public boolean equals(Object obj){
       if (obj == null){
           return false;
       }
       if (obj == this){
           return true;
       }
       if (!obj.getClass().equals(this.getClass())) {
           return false;
       } else {
           Player pObj = (Player)obj;
           return pObj.name.equals(this.name);
       }
   }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 71 * hash + (this.name != null ? this.name.hashCode() : 0);
        return hash;
    }
   /*----------Private functions-----------*/
   /*----------Constructor-----------------*/

   /**
    * constructor
    * @param name
    * @param carac
    */
   public Player(String name, CARAC carac) {
       this.name = name;
       this.carac = carac;
       // 需不需要建出牌库来
   }
   /*----------Gets and sets---------------*/

   public CARAC getCarac() {
       return carac;
   }

   public void setCarac(CARAC carac) {
       this.carac = carac;
   }

   public DeckBuff getDeckBuff() {
       return deckBuff;
   }

   public void setDeckBuff(DeckBuff deckBuff) {
       this.deckBuff = deckBuff;
   }

   public DeckEquipement getDeckEqp() {
       return deckEqp;
   }

   public void setDeckEqp(DeckEquipement deckEqp) {
       this.deckEqp = deckEqp;
   }

   public DeckPlayer getDeckPlayer() {
       return deckPlayer;
   }

   public void setDeckPlayer(DeckPlayer deckPlayer) {
       this.deckPlayer = deckPlayer;
   }

   public String getName() {
       return name;
   }

   public void setName(String name) {
       this.name = name;
   }

   public Role getRole() {
       return role;
   }

   public void setRole(Role role) {
       this.role = role;
   }

   public STATE_CHAIN getStateChain() {
       return stateChain;
   }

   public void setStateChain(STATE_CHAIN stateChain) {
       this.stateChain = stateChain;
   }

}
